package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysBuildingUnitMapper;
import com.ruoyi.system.domain.SysBuildingUnit;
import com.ruoyi.system.service.ISysBuildingUnitService;
import com.ruoyi.common.core.text.Convert;

/**
 * 楼栋和单元关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-06-24
 */
@Service
public class SysBuildingUnitServiceImpl implements ISysBuildingUnitService 
{
    @Autowired
    private SysBuildingUnitMapper sysBuildingUnitMapper;

    /**
     * 查询楼栋和单元关联
     * 
     * @param buildingId 楼栋和单元关联ID
     * @return 楼栋和单元关联
     */
    @Override
    public SysBuildingUnit selectSysBuildingUnitById(Long buildingId)
    {
        return sysBuildingUnitMapper.selectSysBuildingUnitByBuildingId(buildingId);
    }

    /**
     * 查询楼栋和单元关联列表
     * 
     * @param sysBuildingUnit 楼栋和单元关联
     * @return 楼栋和单元关联
     */
    @Override
    public List<SysBuildingUnit> selectSysBuildingUnitList(SysBuildingUnit sysBuildingUnit)
    {
        return sysBuildingUnitMapper.selectSysBuildingUnitList(sysBuildingUnit);
    }

    /**
     * 新增楼栋和单元关联
     * 
     * @param sysBuildingUnit 楼栋和单元关联
     * @return 结果
     */
    @Override
    public int insertSysBuildingUnit(SysBuildingUnit sysBuildingUnit)
    {
        return sysBuildingUnitMapper.insertSysBuildingUnit(sysBuildingUnit);
    }

    /**
     * 修改楼栋和单元关联
     * 
     * @param sysBuildingUnit 楼栋和单元关联
     * @return 结果
     */
    @Override
    public int updateSysBuildingUnit(SysBuildingUnit sysBuildingUnit)
    {
        return sysBuildingUnitMapper.updateSysBuildingUnit(sysBuildingUnit);
    }

    /**
     * 删除楼栋和单元关联对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysBuildingUnitByIds(String ids)
    {
        return sysBuildingUnitMapper.deleteSysBuildingUnitByBulidingIds(Convert.toStrArray(ids));
    }

    /**
     * 删除楼栋和单元关联信息
     * 
     * @param buildingId 楼栋和单元关联ID
     * @return 结果
     */
    @Override
    public int deleteSysBuildingUnitById(Long buildingId)
    {
        return sysBuildingUnitMapper.deleteSysBuildingUnitByBulidingId(buildingId);
    }
}
